import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.net.*;
import java.rmi.*;

public class bt20Button implements ActionListener,InterInterface {
			
			
	
	
	public void actionPerformed(ActionEvent e) {
		
		String rab[] = null;
		
		try {
			Integer.parseInt(taf4.getText());
			Integer.parseInt(taf5.getText());
		
		
		
		if((taf3.getText()).equals("") || (taf4.getText()).equals("") || (taf5.getText()).equals("") )
		{
		JOptionPane.showMessageDialog(null,"Server Configuare Error..","Warning",JOptionPane.ERROR_MESSAGE);		
		return;
		}
		else 
		{
		try
		{
			MainServerImpl msi = new MainServerImpl();
			Naming.rebind("MainServer",msi);
			
			View_Log vl = new View_Log();
			vl.View_Log1();	
			desktop.add(vl);
				try{
				vl.setSelected(true);}
				catch(java.beans.PropertyVetoException p){};
			
				
			System.out.println("Waiting For clients....");
			
			Thr thr1 = new Thr("Thread1");
			thr1.start();
			JOptionPane.showMessageDialog(null,"Server Start Successfully..\nThank you.","Thanks",JOptionPane.INFORMATION_MESSAGE);
			return;
			
		}
		catch(Exception ex)
		{
			System.out.println("Error Occured at the initialing server Object");
			ex.printStackTrace();
		}
	}}
		catch(Exception excecpt){
			JOptionPane.showMessageDialog(null,"Server Configuration Error..\n Please Configure the Server Correctly..","Error",JOptionPane.ERROR_MESSAGE);
			return;
		}
	
	}
}
